<?php
header("Content-type: text/html; charset=utf-8");
 $link = new mysqli('localhost','root','','ghp_mysql');//数据库存在一个ghp_mysql库
 // var_dump($link->connect_errno);
 // var_dump($link->connect_error);
 var_dump($link);
 if($link->connect_error){
 	echo "错误号是；".$link->connect_errno."错误信息是：".$link->connect_error;
  die();
 }
$link->query("SET NAMES 'gbk'");

$sql = "select * from stu where id = ?";

$stmt = $link->prepare($sql);
// var_dump(!$stmt);
if (!$stmt) {
	printf("<b>发生错误：</b>%s",$link->error);
}else{
	
}
?>